package errcode

import (
	"context"
	"go.uber.org/zap"
	"runtime/debug"
	"wx-uniapp-go/third_party/cdslog"
)

// RecoverPanicCtx goroutine处理panic
func RecoverPanicCtx(ctx context.Context) {
	if err := recover(); err != nil {
		cdslog.W(ctx).Error("RecoverPanic", zap.String("stack", string(debug.Stack())), zap.Any("error", err))
	}
}
